# Make sure it produce quwei.so instead of libquwei.so
add_library(hex SHARED quwei.cpp)
target_link_libraries(hex PRIVATE Fcitx5::Core Fcitx5::Module::Punctuation  Fcitx5::Module::QuickPhrase ${CMAKE_CURRENT_SOURCE_DIR}/libconvert.a)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
install(TARGETS hex DESTINATION "${FCITX_INSTALL_LIBDIR}/fcitx5")

# Addon config file
# We need additional layer of conversion because we want PROJECT_VERSION in it.
configure_file(hex-addon.conf.in.in hex-addon.conf.in)
fcitx5_translate_desktop_file("${CMAKE_CURRENT_BINARY_DIR}/hex-addon.conf.in" hex-addon.conf)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/hex-addon.conf" RENAME hex.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon")

# Input Method registration file
fcitx5_translate_desktop_file(hex.conf.in hex.conf)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/hex.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/inputmethod")
